package main

import "fmt"

const (
	BEIJING  = 0
	SHANGHAI = 1
	SHANZHEN = 2
)
const (
	//可以添加iota，每行的iota都会累加，默认第一行为0
	BEIJING2 = iota //10*iota 这种写法也可
	SHANGHAI2
	SHANZHEN2
)

/*
*
注意iota的每一行初始值是不会随着表达式而变化的
*/
const (
	a, b = iota + 1, iota + 10
	c, d
	e, f
	g, h = iota * 10, iota * 100
	j, k
)

func main() {
	//常量（只读属性）
	const name int = 10

	fmt.Println("const is :", name)
	fmt.Println("BEIJING is :", BEIJING)
	fmt.Println("BEIJING2 is :", BEIJING2)
	fmt.Println("a,b is :", a, b)
	fmt.Println("g,h is :", g, h)
}
